package library.operation;

import library.book.BookList;

import java.util.Scanner;

public class BorrowOpretation implements Opretation{
    public void work(BookList bookList) {
        System.out.println("借阅图书");
        System.out.println("请输入你要借阅的书");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        for (int i = 0; i < bookList.getBooksize(); i++) {
            if(name.equals(bookList.getbooks()[i].getName())) {
                bookList.getbooks()[i].setBorrowed(true);
            }
        }
        System.out.println("借阅成功");
    }
}
